package com.owc.common.sdk.request;

import com.owc.common.sdk.AbstractRequest;
import com.owc.common.sdk.response.BalanceResponse;
import lombok.Data;
import org.apache.http.entity.ContentType;

import java.util.Map;

/**
 * @Author Jackies
 * @Date 2019/12/12 21:57
 * @Description TODO://
 **/
@Data
public class BalanceRequest extends AbstractRequest implements Request<BalanceResponse> {

    /**
     * 链名称 例如BTC/ETH
     */
    private String chain;
    /**
     * 代币名称
     */
    private String tokenName;
    /**
     * 钱包地址
     */
    private String address;

    @Override
    protected void setUrlParamsMap(Map<String, Object> map) {
        map.put("chain",chain);
        map.put("tokenName",tokenName);
        map.put("address",address);
    }

    @Override
    public String getApiUrl() {
        return super.getBaseUrl() + "/wallet/getPlatformBalance";
    }

    @Override
    public Class<BalanceResponse> getResponseClass() {
        return BalanceResponse.class;
    }

    @Override
    public Object getUrlParams() {
        setUrlParamsMap(super.urlParamsMap);
        return super.urlParamsMap;
    }

    @Override
    public ContentType getContentType() {
        return ContentType.create(ContentType.APPLICATION_JSON.getMimeType(),"UTF-8");
    }

    @Override
    public String getMethod() {
        return super.method;
    }
}
